//
//  UIImageView+simpleinit.m
//  ebook
//
//  Created by lj on 14-6-16.
//  Copyright (c) 2014年 cczone. All rights reserved.
//

#import "UIImageView+simpleinit.h"

@implementation UIImageView (simpleinit)

-(id) initWithOrigin:(CGPoint)origin Image:(id)imageName
{
    UIImage *image = nil;
    if([imageName isKindOfClass:[UIImage class]])
    {
        image = imageName;
    }
    else if ([imageName isKindOfClass:[NSString class]])
    {
        image = [UIImage imageNamed:imageName];
    }
    if(self = [super initWithFrame:CGRectMake(origin.x, origin.y, 45, 45)])
    {
        self.image = image;
    }
    return self;
}

+(UIImageView *)initWithIconImage:(NSString *)imageName frame:(CGRect)frame{

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:frame];
    [imageView setImage:[UIImage imageNamed:imageName]];
    return imageView;
}

@end
